money = 5000000
name = ""
def checkmoney():
    """查询余额"""
    print(f"您的余额为{money}元")
def protect():
    """存款"""
    global money
    econmy = float(input("请输入存款金额:"))
    money += econmy
    print(f"周杰伦，您好，您的新余额为{money}元")
def take():
    """取款"""
    global money
    econmy = float(input("请输入取款金额:"))
    if econmy > money:
        print("余额不足!")
    else:
     money -= econmy
    print(f"周杰伦，您好，您剩下的存款为{money}元")
def main_menu():
    """主菜单"""
    while 2:
        print("\n周杰伦，您好，欢迎来到黑马银行ATM.请您选择操作：")
        print("1. 查询余额" )
        print("2. 存款")
        print("3. 取款")
        print("4. 退出")
        choice = input("请输入您的选择：")
        if choice == "1":
            checkmoney()
        elif choice =="2":
            protect()
        elif choice =="3":
            take()
        elif choice =="4":
            print("感谢使用黑马ATM系统!")
            break
        else:
            print("输入错误,请重新输入!")
name = input("请输入您的姓名：")
main_menu()